import { Input, View } from "@tarojs/components"
import styles from "./user.module.scss"
import { THEME } from '@/utils/theme'
import { useState } from "react"
import Page from "@/components/Page"
import Taro, { useDidShow } from "@tarojs/taro"
import { AtList, AtListItem } from "taro-ui"
import { toSubPage } from "@/utils"

const User = () => {
    const [themeType, setThemeType] = useState<string>(Taro.getStorageSync('themeType') || 'normal')

    useDidShow(() => {
        setThemeType(Taro.getStorageSync('themeType') || 'normal')
    })

    return (
        <Page>
            <View style={THEME[themeType].styles}>
                <AtList>
                    <AtListItem
                        title='主题设置'
                        arrow='right'
                        iconInfo={{ color: '#78A4FA', value: 'calendar', }}
                        onClick={() => toSubPage('user', 'setting')}
                    />
                </AtList>
            </View>
        </Page>
    )
}

export default User